package com.service.impl;

import com.dao.VisitorLogsDao;
import com.pojo.VisitorLogs;
import com.service.VisitorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class VisitorLogServiceImpl implements VisitorLogService {

    @Autowired
    VisitorLogsDao visitorLogsDao;

    @Transactional
    @Override
    public List<VisitorLogs> searchAll(String param) {
        return visitorLogsDao.searchAll(param);
    }

    @Transactional
    @Override
    public Integer addRecord(VisitorLogs visitorLogs, Integer buildingId) {
        return visitorLogsDao.add(visitorLogs,buildingId);
    }

    @Transactional
    @Override
    public Integer deleteByInfo(String name, String startTime, Integer buildingId) {
        return visitorLogsDao.delete(name,startTime,buildingId);
    }
}
